/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package logica.grafo;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Thiago
 */
public class Grafo {

    private List<Aresta> arestas;
    private List<Vertice> vertices;

    public Grafo() {
        arestas = new ArrayList<Aresta>();
        vertices = new ArrayList<Vertice>();
    }

    public List<Aresta> getArestas() {
        return arestas;
    }

    public List<Vertice> getVertices() {
        return vertices;
    }

    public void setArestas(List<Aresta> arestas) {
        this.arestas = arestas;
    }

    public void setVertices(List<Vertice> vertices) {
        this.vertices = vertices;
    }

    public void adicionaVertice(Vertice v){
        vertices.add(v);
    }

    public Vertice pegaVertice(int index) {
        if (index <= vertices.size()) {
            return vertices.get(index);
        }
        return null;
    }

    public void adicionaAresta(Aresta v) {
        arestas.add(v);
    }

    public Aresta pegaAresta(int index) {
        if (index <= arestas.size()) {
            return arestas.get(index);
        }
        return null;
    }


}
